package com.example.musicrecommend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.musicrecommend.model.dto.question.QuestionQueryRequest;
import com.example.musicrecommend.model.entity.Question;
import com.example.musicrecommend.model.vo.QuestionVO;

/**
* @author cola
* @description 针对表【question(题目)】的数据库操作Service
* @createDate 2024-05-27 19:27:21
*/
public interface QuestionService extends IService<Question> {

    /**
     * 获取查询条件
     * @param questionQueryRequest
     * @return
     */
    QueryWrapper<Question> getQueryWrapper(QuestionQueryRequest questionQueryRequest);

    /**
     * 参数校验
     * @param question
     * @param isAdd
     */
    void validQuestion(Question question, boolean isAdd);

    /**
     * 删除题目
     * @param id
     * @return
     */
    boolean removeQuestion(Long id);

    /**
     * 根据题目id获取题目（带答案）
     * @param id
     * @return
     */
    QuestionVO getQuestionWithAnswer(long id);
}
